<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" http-equiv="content-type" content="text/html" >
    <script src="../js/ajax.js"></script>
    <script>
        function formCheck() {
            var userId=document.getElementById("userId");
            var userPwd=document.getElementById("userPwd");
            var url = "../FormCheck";
            var params="userId="+userId.value+"&userPwd="+userPwd.value;
            sendRequest(url,params,'POST',showResult);
        }
        function showResult() {
            var result = document.getElementById("result");
            if (xmlHttpRequest.readyState == 4){
                if(xmlHttpRequest.status == 200){
                    var info = xmlHttpRequest.responseText;
                    result.innerHTML = info;
                }
            }

        }
    </script>
    <title>表单验证</title>
</head>
<body>
    请输入用户名：<input type="text" id="userId" name="userId" onblur="formCheck()"/><br/>
    请输入密码：<input type="password" id="userPwd" name="userPwd"/><br/>
    <input type="button" value="登陆" onclick="formCheck()"/><br/>
    <div id="result"></div>
</body>
</html>